package com.guapi.dao;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

@TableName("conversation")
@Data
public class Conversation extends BaseDao {
    @TableField("to_id")
    private Integer toId;

    @TableField("from_id")
    private Integer fromId;

    private String content;

    private Integer status;

    private Integer type;

    @TableField("conversation_id")
    private String conversationId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Conversation o1 = (Conversation) o;
        if (ObjectUtil.equal(this.conversationId,o1.getConversationId())) return true;
        return StrUtil.reverse(this.conversationId).equals(o1.getConversationId());
    }

}
